;;; gnu-plot-settings.el ---
;; -*- Emacs-Lisp -*-

;; Time-stamp: <2010-04-13 02:43:02 Tuesday by Mugua>

;; This  file is free  software; you  can redistribute  it and/or
;; modify it under the terms of the GNU General Public License as
;; published by  the Free Software Foundation;  either version 3,
;; or (at your option) any later version.

;; This file is  distributed in the hope that  it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR  A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You  should have  received a  copy of  the GNU  General Public
;; License along with  GNU Emacs; see the file  COPYING.  If not,
;; write  to  the Free  Software  Foundation,  Inc., 51  Franklin
;; Street, Fifth Floor, Boston, MA 02110-1301, USA.


;;; Commentary:
;;
;; Edit by zuojg

;;; Code:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Edit by zuojg
;; 设置 gnu-plot, 可以再Emacs 里调用gnuplot来画图
(require 'gnuplot)
(autoload 'gnuplot-mode "gnuplot" "gnuplot major mode" t)
(autoload 'gnuplot-make-buffer "gnuplot" "open a buffer in gnuplot mode" t)
;;编辑gp 和plt 类型的文件时自动进入gnuplot 模式
(setq auto-mode-alist (append '(("\\.gp$" . gnuplot-mode)) auto-mode-alist))
(setq auto-mode-alist (append '(("\\.plt$" . gnuplot-mode)) auto-mode-alist))
(setq gnuplot-echo-command-line-flag nil)

;;注意到custom-set-variables下的gnuplot-program是必须的，否则无法运行。
;;绑定F9 键打开一个gnuplot 的缓冲区
;;(global-set-key [(f9)] 'gnuplot-make-buffer)
(eal-define-keys-commonly
 global-map
 '(("M-C-g" org-plot/gnuplot)))

(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(column-number-mode t)
 '(display-time-mode t)
 '(doc-view-ghostscript-program "gswin32c")
 '(gnuplot-program "~/Tools/gnuplot/bin/pgnuplot.exe")
 '(show-paren-mode t))

(provide 'gnu-plot-settings)
